Asc Function
Returns as an Integer, the ASCII value for the first character of a String.
Syntax
result = Asc( string )
result = stringVariable.Asc
Parameters | ||
string |
Any valid String expression. |
Notes
The Asc function returns the code point for the first character in the String passed. Characters 0 through 127 are the standard ASCII set. They will be the same on practically every platform. Asc returns the code point for whatever encoding the string is in. If the string is in MacRoman, you get the code point specified by MacRoman, and so forth.
If you need to get the ASCII code of the first byte of the string rather than the first character, use the AscB function.
Examples
This example uses the Asc function to get the ASCII value of a character.
This example gets the code point for the "‚â•" symbol
:
See Also
Chr, InStr, Left, Len, Mid, Right functions; TextEncoding class.